---
import ForgotPasswordForm from '../components/Profile/ForgotPasswordForm';
import SettingLayout from '../layouts/SettingLayout.astro';
---

<SettingLayout title='Forgot Password'>
  <div class='container py-16'>
    <ForgotPasswordForm client:load />

    <div class='mt-6 text-center text-sm'>
      Don't have an account? <a
        href='/signup'
        class='font-medium text-blue-600 transition duration-150 ease-in-out hover:text-blue-500'
        >Sign up</a
      >
    </div>
  </div>
</SettingLayout>

<script>
  import Cookies from 'js-cookie';
  import { TOKEN_COOKIE_NAME } from '../lib/constants';
  const token = Cookies.get(TOKEN_COOKIE_NAME);

  if (token) {
    window.location.href = '/';
  }
</script>
